
'use strict';
var _mm=require('common/util/mm.js');





var _user={
	//	检查用户名是否占用 
	checkUsername:function(username ,resolve, reject) {
		_mm.request({
			url    :_mm.getServerUrl('/user/check_valid.do'),
			
			data:username,
			success:resolve,
			error  :reject,

		})
	},
	//注册 
	register:function(userInfo ,resolve, reject) {
		_mm.request({
			url    :_mm.getServerUrl('/user/register.do'),
			data:userInfo,
			success:resolve,
			error  :reject,

		})
	},
	//登陆 确定 
	login:function(userInfo ,resolve, reject) {
		_mm.request({
			url    :_mm.getServerUrl('/user/login.do'),
			data:userInfo,
			success:resolve,
			error  :reject,

		})
	}, 
	//获取用户信息
	getUserInfo:function(resolve, reject) {
		_mm.request({
			url    :_mm.getServerUrl('/user/get_information.do'),
			success:resolve,
			error  :reject,

		})
	},
	//检查登陆状态
	checkLogin:function(resolve, reject) {
		_mm.request({
			url    :_mm.getServerUrl('/user/get_user_info.do'),
			success:resolve,
			error  :reject,

		})
	},
	//登出
	logout:function(resolve, reject) {
		_mm.request({
			url    :_mm.getServerUrl('/user/logout.do'),
			success:resolve,
			error  :reject,

		})
	},
	//获取用户密码提示问题 
	getQuestion:function(username ,resolve, reject) {
		_mm.request({
			url    :_mm.getServerUrl('/user/forget_get_question.do'),
			data:username,
			success:resolve,
			error  :reject,

		})
	},
	// 检查密码提示问题的答案
	checkAnswer:function(userInfo ,resolve, reject) {
		_mm.request({
			url    :_mm.getServerUrl('/user/forget_check_answer.do'),
			data:userInfo,
			success:resolve,
			error  :reject,

		})
	},
	resetPassword:function(userInfo ,resolve, reject) {
		_mm.request({
			url    :_mm.getServerUrl('/user/forget_reset_password.do'),
			data:userInfo,
			success:resolve,
			error  :reject,

		})
	},
	//修改用户信息
	updateUserinfo:function(userInfo,resolve,reject){
		_mm.request({
			url    :_mm.getServerUrl('/user/update-information.do'),
			data:userInfo,
			success:resolve,
			error  :reject,

		})
	},
	//用户中心修改用户密码
	updateUserinfo:function(userInfo,resolve,reject){
		_mm.request({
			url    :_mm.getServerUrl('/user/reset-password.do'),
			data:userInfo,
			success:resolve,
			error  :reject,

		})
	},
	logout:function(resolve, reject) {
		_mm.request({
			url    :_mm.getServerUrl('/user/logout.do'),
			success:resolve,
			error  :reject,

		})
	},


}
module.exports =_user;

 




